package com.tianyuan.dplrf.ui.common;

import android.graphics.Rect;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.xuexiang.xutil.XUtil;
import com.xuexiang.xutil.display.DensityUtils;


public class SpaceItemDecoration extends RecyclerView.ItemDecoration {
    private int dec;

    public SpaceItemDecoration(int deci) {
        this.dec = DensityUtils.dip2px(deci);
    }

    @Override
    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
        outRect.left = dec;
        outRect.right = dec;
        outRect.top = dec;
        outRect.bottom = dec;
//        if (0 == parent.getChildItemId(view)){
//            outRect.left = dec+dec+dec;
//        }
    }
}
